package designpattern;

/**
 * @author MI
 * @version 1.0
 * @date 2020/12/20 22:14
 */
public class SingleResponsibility2 {

    public static void main(String[] args) {
        final RoadVehicle roadVehicle = new RoadVehicle();
        roadVehicle.run("汽车");
        final AirVehicle airVehicle = new AirVehicle();
        airVehicle.run("飞机");
    }
}

class RoadVehicle {
    public void run(String vehicle) {
        System.out.println(vehicle + " 在公路上运行");
    }
}

class AirVehicle {
    public void run(String vehicle) {
        System.out.println(vehicle + " 在水中运行");
    }
}
